// This file is much like simplify.h in the sence of functions' purpose.
// They eliminate most nodes from given contours, replacing them by bezier polynomial pieces.

// Output from the fuctions is a vector of nodes, that should be interpretd as follows:
// start point, control point 1, control point 2, common point, control point 1, control point 2...
// (The size of the vector is one more than three times the number of pieces, 
// because each Bezier curve requires two control points and an endpoint, and the initial curve requires an additional starting point.)

#pragma once

#include "outline.h"

namespace outline {

struct simplify_precision {
	/// initially when simplify selects where to insert control points it builds curves with low quality
	unsigned low_max_iterations;
	float low_stop_mean_discrepancy;
	/// at finish curves are rebuilded with high quality
	unsigned hi_max_iterations;
	float hi_stop_mean_discrepancy;
};

extern simplify_precision default_simplify_precision;

//meaning of particular functions see in simplify.h;
//the difference is input type (typically integer) and output type (some real) may not be same

template <typename T, typename R>
double simplify_using_bezier_min_step_len(int min_step_len,
	std::vector< point<T> > const & src, std::vector< point<R> > & dst,
	simplify_precision const & prec = default_simplify_precision);

template <typename T, typename R>
double simplify_using_bezier_min_step_len(int min_step_len,
	std::vector<std::vector<point<T> > > const & src, std::vector<std::vector<point<R> > > & dst,
	simplify_precision const & prec = default_simplify_precision);
/*
template <typename T, typename R>
double simplify_using_bezier_to_K_nodes(int K,
	std::vector< point<T> > const & src, std::vector< point<R> > & dst);

template <typename T, typename R>
double simplify_using_bezier_avg_step_len(float avg_step_len,
	std::vector<std::vector<point<T> > > const & src, std::vector<std::vector<point<R> > > & dst);

template <typename T, typename R>
double simplify_using_bezier_max_discrepancy(double max_discrepancy,
	std::vector< point<T> > const & src, std::vector< point<R> > & dst);

template <typename T, typename R>
double simplify_using_bezier_avg_discrepancy(double avg_discrepancy,
	std::vector<std::vector<point<T> > > const & src, std::vector<std::vector<point<R> > > & dst);
*/
} //namespace outline
